﻿using System.Collections.ObjectModel;
using System.Xml.Serialization;

namespace ElectronicCommerce.Framework.Web.Configuration.Resource
{
    public class PageInfo
    {
        [XmlAttribute("name")]
        public string Name { get; set; }

        [XmlAttribute("path")]
        public string Path { get; set; }

        [XmlAttribute("id")]
        public int Id { get; set; }

        [XmlAttribute("title")]
        public string Title { get; set; }

        [XmlAttribute("belong")]
        public string Belong { get; set; }

        [XmlAttribute("httpProtocol")]
        public HttpProtocol HttpProtocol { get; set; }

    }

    public class PageCollection : KeyedCollection<string, PageInfo>
    {
        protected override string GetKeyForItem(PageInfo item)
        {
            return item.Name.ToUpper();
        }
    }
}
